home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / Apple Game Sprockets / DrawSprocket / GoggleSprocket / GoggleSprocketDevices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-12  |  3.5 KB  |  123 lines  |  [TEXT/CWIE]

  1. /*
  2. ********************************************************************************
  3. **
  4. ** Name: GoggleSprocketDevices.h
  5. **
  6. ** Description:
  7. **
  8. **    Header file for the device-level interface for stereoscopic devices.
  9. **
  10. ********************************************************************************
  11. */
  12. #ifndef GOGGLESPROCKETDEVICES
  13. #define GOGGLESPROCKETDEVICES
  14.  
  15. #include <Displays.h>
  16. #include <Types.h>
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. /*
  23. ********************************************************************************
  24. ** constants & data types
  25. ********************************************************************************
  26. */
  27. /* GoggleSprocket file creator type */
  28. #define kGoggleSprocketCreatorType 'GSp '
  29.  
  30. /* device error codes */
  31. enum {
  32.     kGSpDeviceError_NoMoreModes            = 1,
  33.     kGSpDeviceError_UnsupportedCall        = 2
  34. };
  35. typedef UInt32 gDSpDeviceError;
  36.  
  37. /* device type */
  38. enum {
  39.     kGSpDeviceKind_Unknown            = 0,
  40.     
  41.     /* frame sequential devices alternate the eyes being displayed */
  42.     kGSpDeviceKind_FrameSequential    = 1,    /* i.e. shutter glasses */
  43.     
  44.     /* stereoscopic devices show both eyes at the same time */
  45.     kGSpDeviceKind_Stereoscopic        = 2        /* i.e. hmd, anaglyph */
  46. };
  47. typedef UInt32 GSpDeviceKind;
  48.  
  49. /* mode data format */
  50. enum {
  51.     kGSpModeDataFormat_Unknown                = 0,
  52.     kGSpModeDataFormat_Normal                = 1,
  53.     kGSpModeDataFormat_Interleaved            = 2
  54. };
  55. typedef UInt32 GSpModeDataFormat;
  56.  
  57. /* mode attributes */
  58. enum {
  59.     kGSpModeAttribute_CustomProcess                = (1L << 0L),
  60.     kGSpModeAttribute_FullDisplayRequired        = (1L << 1L),
  61.     kGSpModeAttribute_ManualEyeToggleRequired    = (1L << 2L),
  62.     kGSpModeAttribute_RightEyeDataFirst            = (1L << 3L),
  63.     kGSpModeAttribute_PrimeBuffers                = (1L << 4L)
  64. };
  65. typedef UInt32 GSpModeAttributes;
  66.  
  67. /* mode information */
  68. struct GSpDeviceModeInfo {
  69.     GSpModeDataFormat        format;
  70.     GSpModeAttributes        attributes;
  71.     
  72.     /* non-zero if attached to specific display */
  73.     DisplayIDType            displayID;
  74.     
  75.     /* display requirement ranges are [low,high] inclusive bounds, 0 = don't care */
  76.     UInt32                    displayWidthRange[2];
  77.     UInt32                    displayHeightRange[2];
  78.     UInt32                    displayDepthRange[2];
  79.     
  80.     /* frequencies are Fixed point values */
  81.     Fixed                    displayFrequencyRange[2];
  82. };
  83. typedef struct GSpDeviceModeInfo GSpDeviceModeInfo;
  84.  
  85. /*
  86. ********************************************************************************
  87. ** calls exported by the stereoscopic device driver
  88. ********************************************************************************
  89. */
  90. /* general */
  91. OSStatus GSpDevice_Open( void );
  92. OSStatus GSpDevice_Close( void );
  93.  
  94. /* device configuration */
  95. OSStatus GSpDevice_Configure( Point *inUpperLeft );
  96.  
  97. /* mode iteration */
  98. OSStatus GSpDevice_GetFirstModeInfo( GSpDeviceModeInfo *outFirstModeInfo );
  99. OSStatus GSpDevice_GetNextModeInfo( GSpDeviceModeInfo *inCurrentModeInfo,
  100.             GSpDeviceModeInfo *outNextModeInfo );
  101.  
  102. /* for manual eye toggle */
  103. OSStatus GSpDevice_SetVisibleEye( Boolean inLeftEyeVisible );
  104. OSStatus GSpDevice_GetVisibleEye( Boolean *outLeftEyeVisible );
  105.  
  106. /* custom buffer processing by device */
  107. OSStatus GSpDevice_CustomBufferProcess(
  108.             CGrafPtr inLeftEyeBuffer,        /* left eye image                */
  109.             CGrafPtr inRightEyeBuffer,        /* right eye image                */
  110.             CGrafPtr inDestBuffer,            /* dest buffer                    */
  111.             Boolean inBuildLeftEyeBuffer,    /* 0 = build right eye image    */
  112.             CTabHandle ioColorTable,        /* src color table to use        */
  113.             Boolean *outShowDisplayBuffer,    /* 0 = driver will show output    */
  114.             Boolean *outCTabChanged );        /* 0 = driver didnt change ctab    */
  115.  
  116. /* new in 1.1.2 */
  117. OSStatus GSpDevice_GetDeviceKind( GSpDeviceKind *outDeviceKind );
  118.     
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122.  
  123. #endif /* GOGGLESPROCKETDEVICES */